<?php

require_once ("memberModel.php");

class SearchModel {
    
    public $m_facadeModel ;
    
    public function __construct(FacadeModel $a_facadeModel) {
        $this->m_facadeModel = $a_facadeModel;
    }

	public function search(ISearchable $a_interface) {

        $resultArray = array() ;

        foreach($this->m_facadeModel->getMembers() as $member) {
            if($a_interface -> isSelected($member)) {
                 $resultArray[] = $member ;
            }
        }
        
        return $resultArray ;

	}
    
    // $searchModel(new nameSearch("olle")) ;
}
